<body>
<{$xajax_scripts}> 
<form method='post' onsubmit='return check_form_pass();'>
<input type='hidden' name='op' value='import_file'>
<div class=form_title><{$smarty.const.MI_IMPORT_DATA}></div>
  <br>
  <table width="50%" border='1'  align=center cellpadding='1' cellspacing="1" class='form_detail' cellspan='0'>
    <script>

function checkIsValidDate(str)
{
  if (str == "")
     return true;
  var pattern = /^(\d{4})\-(\d{1,2})\-(\d{1,2})$/g;
  if(!pattern.test(str))
     return false;
  var arrDate = str.split("-");
  if(parseInt(arrDate[0],10) < 100)
     arrDate[0] = 2000 + parseInt(arrDate[0],10) + "";
  var date = new Date(arrDate[0],(parseInt(arrDate[1],10) -1)+"",arrDate[2]);
  if(date.getYear() == arrDate[0]
     && date.getMonth() == (parseInt(arrDate[1],10)-1)+""
     && date.getDate() == arrDate[2])
     return true;
  else
     return false;
}

function check_form_pass()
{
    if (document.getElementById('imp_img_file1').value == '')
    {
        alert('<{$smarty.const.MI_ERROR_REQUIRE_IMPORT_SOURCE}>');
        return false;
    }

    return true;
}

</script>
    <tr bordercolor="#cbe5f6"> 
      <td></td>
      <td><input type='checkbox' style='cursor: pointer;' name='analysis_screen_first' value='import_img' <{if 
        $analysis_screen_first == 'import_img'}>checked <{/if}> onclick='if (this.checked) 
        { location.href="/analysis.php?op=display_import_img&analysis_screen_first=import_img"; 
        } else { location.href="/analysis.php?op=display_import_img&analysis_screen_first=analysis"; 
        }'><{$smarty.const.MI_IMPORT_SCREEN_IMG_FIRST}></td>
    </tr>
    <tr bordercolor="#cbe5f6"> 
      <th><{$smarty.const.MI_SELECT_KIT_ID}></th>
      <td> 
        <select name='kit_id' onchange='location.href="/analysis.php?op=display_import_img&kit_id="+this.value;'><{foreach from=$kit_id_list key=kit_id item=kit_desc }> <option value='<{$kit_id}>'<{if $kit_id==$current_kit_id }> selected<{/if}>><{$kit_id}> - <{$kit_desc}></option> <{/foreach}> 
        </select></td>
    </tr>
    <{foreach from=$sample_images item=field_name}> 
    <tr bordercolor="#cbe5f6"> 
      <th><{$smarty.const.MI_SAMPLE_IMAGE_FILE}> <{$field_name}></th>
      <td> <{if $is_use_wab_console == true }> 
        <input type='text' style='cursor: pointer;' id='imp_img_file<{$field_name}>' size="60" name='imp_img_file<{$field_name}>' onclick='xajax_Ajax_SelectFile("Sample Image", "JPEG Image Files(*.jpg;*,jpeg)|*.jpg;*,jpeg", "imp_img_file<{$field_name}>");'> 
        <{else}><input type='file' style='cursor: pointer;' name='imp_img_file<{$field_name}>' size="60" /> 
        <{/if}></td>
    </tr>
    <{/foreach}> 
  </table>
  <br>
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<input name="submit" type="submit" class='btn_import' value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<{$smarty.const.MI_IMPORT}>" /> 
      <input name="button" type='button' class='btn_uppage' onClick='location.href="/analysis.php?op=display";' value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<{$smarty.const.MI_DISPLAY_INPUT}>" /></td>
  </tr>
</table>
</form>
<script>
  document.getElementById('kit_id').focus();
</script>
